/**
 * 初始化
 */
function initList(_form){

	//全局变量设定
	$pageSizeSelect = $("#pageSizeSelect");	//size设置
	$pageSize = $("#pageSize");	//size值
	$pageSizeOption = $("#pageSizeOption");	//size选项
	$searchPropertySelect = $("#searchPropertySelect");	//搜索条件设置
	$searchPropertyOption = $("#searchPropertyOption");	//搜索条件选项
	$searchValue = $("#searchValue");	//搜索值
	$searchType = $("#searchType");	//搜索类型
	$pageNum = $("#pageNum");	//当前页码
	$listTable = $("#listTable");	//查询结果表格
	$searchBtn = $("#searchBtn");	//查询按钮
	$selectAll = $("#selectAll");	//全选按钮
	$deleteButton = $("#deleteButton");	//删除按钮
	$refreshButton = $("#refreshButton");	//刷新按钮
	$form = $(_form);	//表单
	
	//查询按钮点击事件
	$searchBtn.click(function(){
		pageNum = 1;
		$form.submit();
	});
	
	//刷新按钮事件
	$refreshButton.click(function(){
		pageNum = 1;
		$form.submit();
	});
	
	$pageSizeSelect.mouseover(popMouseOver);	//size弹出选项
	$searchPropertySelect.mouseover(popMouseOver);	//搜索条件弹出选项
	searchType = "";
	pageNum = 1;
	pageSize = 10;
};


/*
 * 每页显示数目选择
 */
function popMouseOver(){
	var $this = $(this);
	var offset = $this.offset();
	var $menuWrap = $this.closest("div.menuWrap");
	var $popupMenu = $menuWrap.children("div.popupMenu");
	$popupMenu.css({left: offset.left, top: offset.top + $this.height() + 2}).show();
	$menuWrap.mouseleave(function() {
		$popupMenu.hide();
	});
}

/**
 * 选择每页显示数量选项
 * @param _size
 * @return
 */
function selectPageSizeOption(_this, _size){
	$this = $(_this);
	$pageSizeOption.find(".current").removeAttr("class");
	$this.attr("class", "current");
	pageSize = _size;
}

/**
 * 选择查询条件选项
 * @param _this
 * @param _type
 * @return
 */
function selectSearchType(_this, _type){
	$this = $(_this);
	$searchPropertyOption.find(".current").removeAttr("class");
	$this.attr("class", "current");
	window.searchType = _type;
}

/**
 * 
 * @param _rowId
 * @return
 */
function onSelectRow_Default(_rowId){
	if(this.selected.length < 1){
		$deleteButton.addClass("disabled");	//失效删除按钮
	} else {
		$deleteButton.removeClass("disabled");	//生效删除按钮
	}
}